package com.boge.study.design_pattern.observer.pull_model;

public class Test {

    public static void main(String[] args) {
        //创建目标
        ConcreteWeatherSubject weatherSubject = new ConcreteWeatherSubject();

        //创建观察者
        ConcreteObserver observer1 = new ConcreteObserver();
        observer1.setObserverName("路人甲");
        observer1.setRemindThing("去逛街");

        ConcreteObserver observer2 = new ConcreteObserver();
        observer2.setObserverName("路人乙");
        observer2.setRemindThing("去看电影");

        //注册观察者
        weatherSubject.add(observer1);
        weatherSubject.add(observer2);

        //目标发布天气信息
        weatherSubject.setWeatherContent("天气晴朗");

    }


}
